/* 
 * File:   dictionary.h
 * Author: Luis Aguirre
 * Description: Represents te dictionary that contains the words to generate a back book index
 *
 * Created on jule, 23, 2013, 01:51 PM
 */

#ifndef DICTIONARY_H
#define	DICTIONARY_H

#include <list>
#include <string>
#include "../exceptions/fileexception.h"
#include "../exceptions/filenotfoundexception.h"
#include "../exceptions/nullpathexception.h"
#include "../exceptions/openfileexception.h"

struct Dictionary
{
    /**
     * Initialize the dictionary reading the words and saving in a list.
     * 
     * @param dictionaryPath Path of the dictionary.
     */
    Dictionary(const char* dictionaryPath);
    
    /**
     * Words of the dictionary
     */
    std::list<std::string> words;
    
private:
    
    /**
     * Read the words
     * @param path
     */
    void readDictionary(const char* path) throw (FileException);
};


#endif	/* DICTIONARY_H */
